<?php
/**
 * Created by PhpStorm.
 * User: qzy008
 * Date: 2018/9/19
 * Time: 17:35
 */

namespace app\lib\tools;


use think\Request;

class ResultHandler
{
    public static function returnJson($message, $data=null, $error_code=0, $statusCode=200)
    {
        $json = [
            'msg' => $message,
            'data' => $data,
            'error_code' => $error_code,
            'request_url' => Request::instance()->url()
        ];
        return json($json, $statusCode);
    }
}